package com.yyfax.pay.third.model.to.fuiou;

import java.util.Map;

import org.apache.commons.lang3.StringUtils;

import com.yyfax.framework.model.Params;
import com.yyfax.framework.yyfax.enums.RspCodeEnum;
import com.yyfax.pay.common.exception.YYPayException;

/**
 * 商户再次协议下单接口参数
 * 
 * @author heizq
 * @date 2017-05-09 19:26:21
 * @since v1.2.0
 */
@SuppressWarnings({ "serial" })
public class ProtocolPayOrderAgainFuiouParams extends Params {

	/**
	 * 获取验证码URL
	 */
	private String url;

	/**
	 * 商户密钥
	 */
	private String merchantSecurit;

	/**
	 * 用户id
	 */
	private String userId;

	/**
	 * 请求参数
	 */
	private Map<String, String> params;

	/**
	 * 日志请求参数
	 */
	private Map<String, String> logParam;

	@Override
	public boolean validate() throws Exception {
		if (StringUtils.isBlank(url)) {
			throw new YYPayException(RspCodeEnum.COMMON_ERROR_PARAMETER_INVALID, "url参数不能为空");
		}
		if (StringUtils.isBlank(merchantSecurit)) {
			throw new YYPayException(RspCodeEnum.COMMON_ERROR_PARAMETER_INVALID, "merchantSecurit参数不能为空");
		}
		if (params == null) {
			throw new YYPayException(RspCodeEnum.COMMON_ERROR_PARAMETER_INVALID, "params参数不能为空");
		}
		return false;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getMerchantSecurit() {
		return merchantSecurit;
	}

	public void setMerchantSecurit(String merchantSecurit) {
		this.merchantSecurit = merchantSecurit;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public Map<String, String> getParams() {
		return params;
	}

	public void setParams(Map<String, String> params) {
		this.params = params;
	}

	public Map<String, String> getLogParam() {
		return logParam;
	}

	public void setLogParam(Map<String, String> logParam) {
		this.logParam = logParam;
	}
}
